const mongoose = require("../config/db");
const moment = require('moment')
const NoticesSchema = mongoose.Schema({
  notice_text: {
    type: String,
    required: true,
  },
  notice_type: {
    type: String,
    required: true,
  },
  notice_state: {
    type: Number,
    default: 1, // 启用
    required: true,
  },
  creator: {
    type: String,
    required: true,
  },
  add_time: {
    type: Date,
    default: moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
  }
}, {
  versionKey: false
})
const NoticesModel = mongoose.model("Notices", NoticesSchema, "notices");
// NoticesModel.create({
//   "notice_text": "notice_text",
//   "notice_type": "notice_type",
//   "notice_state": 1,
//   "creator": "creator"
// });
module.exports = NoticesModel;